package com.air.ota.vo;

import com.air.ota.util.HexStringUtil;

public class SZTRegResultReqTransVO extends SZTBaseReqTransVO{
	
	private byte[] cardAppSequence;
	private byte[] regResult;
	private byte[] cardRemain;
	private byte[] cardTransSequence;
	
	
	public SZTRegResultReqTransVO(byte[] deviceSequence, byte[] sztSequence,String deviceTriggerTime,
			byte[] cardAppSequence,byte[] regResult)
			throws Exception {
		super(deviceSequence, sztSequence,deviceTriggerTime);
		
		this.transTypeCode = 0x01;
		this.subTransTypeCode  = 0x12;
		//this.cardPhyType = 0x02;
		this.tranAppendCode = 0x03;
		
		this.cardAppSequence = cardAppSequence;
		this.regResult = regResult;
		this.cardRemain = HexStringUtil.hexStringToBytes("00000000");
		this.cardTransSequence = HexStringUtil.hexStringToBytes("0000");;
		
		this.transData  = makeTransData();
	}
	
	public byte[] makeTransData(){
		StringBuffer hexStringBuf = new StringBuffer();
		
		hexStringBuf.append(HexStringUtil.bytesToHexString(this.cardAppSequence));
		hexStringBuf.append(HexStringUtil.bytesToHexString(this.regResult));
		hexStringBuf.append(HexStringUtil.bytesToHexString(this.cardRemain));
		hexStringBuf.append(HexStringUtil.bytesToHexString(this.cardTransSequence));
		
		return HexStringUtil.hexStringToBytes(hexStringBuf.toString());
	}

}
